<%@ page import="constutil.Constants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            border: 1px solid red;
        }
        .con{
            display: flex;
            height: 100vh;
            justify-content: center;
            align-items: center;
        }
        .con .login{
            width: 550px;
            height: 300px;
            display: flex;
            /* flex-direction: column; */
            justify-content: center;
            align-items: center;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="con">
    <div class="login">
        <form action="<%=request.getContextPath()%>/loginServlet" method="post">
            <input type="text" name="username" value=""/><br/>
            <input type="password" name="password" /><br/>
            <input type="submit" value="登录">
            <%
                String loginInfo = request.getAttribute(Constants.LOGIN_INFO) == null? null : request.getAttribute(Constants.LOGIN_INFO).toString();
                if(null != loginInfo && loginInfo.length() > 0){
                    %>
                <span style="color:red">登录异常：<%=loginInfo%></span>
            <%
                }
            %>

        </form>
    </div>
</div>

</body>
</html>